http = require("http")
url = require("url")
fs = require("fs")
server = http.createServer((request, response) ->
  regex = new RegExp("^/Home/Index/?$")
  pathname = url.parse(request.url).pathname
  if regex.test(pathname)
    response.writeHead 200,
      "content-type": "text/html"

    fs.readFile "./index.html", (err, data) ->
      response.write data
      response.end()

  else
    response.writeHead 404,
      "content-type": "text/plain"

    response.end "File not found"
)

#Ser um að skila upphafsstodu spjallherbergis, þ.e. þegar notandi kemur inn
app.get "/rooms/:roomID", ->


#TODO: Fletta upp þessu herbergi
#	ef það finnst og notandi er ekki banned(ekki buid ad sparka) -> skila spjallinu í því herbergi + notendalista
server.listen 8000
console.log "server running at http://localhost:8000"


